package com.mw.wmimobile.gui.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.Spanned;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.webkit.WebView;
import android.widget.TextView;

import com.mw.wmimobile.datastorage.NewsSmallDto;
import com.mw.wmimobile.datastorage.DataStorage;
import com.wm.wmimobile.R;

public class NewsActivity extends Activity {

	private TextView newsTextView;
	private int position;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Intent intent = getIntent();
		position = intent.getIntExtra("position", -1);
		Log.d("pozycja: ", Integer.toString(position));
		setContentView(R.layout.news_activity);

		Spanned spanned;

		NewsSmallDto newsDto = DataStorage.getInstance().getNewsSmallList().get(position);
		

		newsTextView = (TextView) findViewById(R.id.NewsTextItem);
		String news = newsDto.getText();
		
		spanned = Html.fromHtml(news);
		newsTextView.setText(spanned);
	
	}
}
